﻿@using Gx.Model.Entity;
@using Gx.Model.ViewModel;
@model List<LKWarehouseContractDetail>
@{
    int i = 1;
}

@foreach (var item in Model)
{
    <tr id="@("detail")@i">
        @*<td>@i</td>*@
        <td>
            <input id="@("BeginTime")@i" class="easyui-datebox" value="@item.BeginTime.ToString("yyyy-MM-dd")" style="width: 120px; height: 30px;" readonly="readonly" />
            <input type="hidden" id="@("DetailDomId")@i" value="@i" />
            <input type="hidden" id="@("DetailId")@i" value="@item.Id" />
            <input type="hidden" id="@("ContractId")@i" value="@item.ContractId" />
        </td>
        <td><input id="@("EndTime")@i" class="easyui-datebox" value="@item.EndTime.ToString("yyyy-MM-dd")" style="width: 120px; height: 30px;" readonly="readonly" /></td>
        <td><input id="@("UnitPrice")@i" class="easyui-numberbox" value="@Math.Round(item.UnitPrice, 2)" data-options="precision:'2',prompt:'单价'" style="width: 80px; height: 30px;" readonly="readonly" /></td>
        <td><input id="@("Number")@i" class="easyui-numberbox" value="@item.Number" data-options="prompt:'数量'" style="width: 80px; height: 30px;" readonly="readonly" /></td>
        <td><input id="@("OriginalAmount")@i" class="easyui-numberbox" value="@Math.Round(item.OriginalAmount, 2)" data-options="precision:'2',prompt:'原金额'" style="width: 80px; height: 30px;" readonly="readonly" /></td>
        <td><input id="@("TotalPrice")@i" class="easyui-numberbox" value="@Math.Round(item.TotalPrice, 2)" data-options="precision:'2',prompt:'总金额',onChange:calculateAmount2" style="width: 80px; height: 30px;" /></td>
        <td><input class="easyui-switchbutton" id="@("sbIsBalance")@i" data-options="onText:'是',offText:'否'"></td>
        <td><input class="easyui-switchbutton" id="@("sbIsCharge")@i" data-options="onText:'是',offText:'否'"></td>
    </tr>
    //i++;

    <script type="text/javascript">
    $(function () {
        $('@("#sbIsBalance")@i').switchbutton({ checked: @Html.Raw(item.IsBalance ? "true" : "false") });
        $('@("#sbIsCharge")@i').switchbutton({ checked: @Html.Raw(item.IsCharge ? "true" : "false") });
    });
    </script>
    i++;
}